<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取贷款申请信息</title>
  <script language="javascript" type="text/javascript" src="../vue/vue2.x.js"></script>
  <script language="javascript" type="text/javascript" src="../elementUI/elementUI2.x.js"></script>
  <!--        <link rel="stylesheet" href="elementUI/elementUI2.x.css" type="text/css">-->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  <style type="text/css">
    *{
      margin: 0;
      padding: 0;
    }
    .el-collapse-item__header>span{
      margin-left: 150px;
    }
    .el-collapse-item__header>span:first-child{
      margin:0;
    }
    .files-div{
      display: inline-block;
      width: 33.33%;
      vertical-align: top;
    }
    #purpose{
      margin: 20px 0;
    }
    h3,p{
      display: inline-block;
    }
  </style>
</head>
<body>
  <div id="app">
    <el-collapse accordion>
      <el-collapse-item v-for="item in loansData">
        <template slot="title">
          <span id="user_mail">账户：{{ item.user_mail }}</span>
          <span id="loans_date">提交时间：{{ item.Loans_date }}</span>
          <span id="due_date">预计还款时间：{{ item.Due_date }}</span>
          <span id="stateType">状态：<el-tag :type="item.stateType">{{ item.Loans_state }}</el-tag></span>
        </template>
        <div id="purpose"><h3>详细描述：</h3><p>{{ item.Loans_purpose }}</p></div>
        <div class="files-div" v-for="subItem,subKey in item.fileImg">
          <div>{{ subKey }}: </div><img style="width:200px;height: 150px;border-radius: 20px" :src="'../'+subItem">
        </div>
      </el-collapse-item>
    </el-collapse>
  </div>
  <script type="text/javascript">
    var vm = new Vue({
      el:'#app',
      data: {
        loansData:[]
      },
      mounted: function () {
        //加载信息
        axios.post('/user/getLoansInfo').then((resp) => {
          console.log(resp.data);
          this.loansData = resp.data;
        }).catch((err) => {
          console.log(err)
        });
      },
      methods:{

      }
    })
  </script>
</body>
</html>
